package com.gaozhen.demo;

import java.util.Scanner;

public class Tset5 {
    public static void main(String[] args) {
        //评委打分
        //6名评委打分【0-100】之间，去掉最高，去掉最低，求最后选手平均分
        int[] scores = new int[6];
        Scanner p = new Scanner(System.in);
        for (int i = 0; i < scores.length; i++) {
            System.out.println("请输入第"+(i+1)+"个评委的打分。");
            int score = p.nextInt();
            scores[i] = score;
        }
        int max = scores[0];
        int min = scores[0];
        int sum = 0;
        for (int i = 0; i < scores.length; i++) {
            if (scores[i]>max ){
                max = scores[i];
            }
            if (scores[i]<min){
                min = scores[i];
            }
            sum += scores[i];
        }
        System.out.println("最高分是："+max);
        System.out.println("最低分是："+min);
        double result = (sum - max - min)*1.0 / (scores.length - 2);
        System.out.println("选手最终得分是："+result);
    }
}
